---
#Prepare master
- name: login to registry
  docker_login:
    registry: dockerhub.company.ru:5000
    username: openshift.projectname
    password: xxxxxxxxxxxxxxxxxx
    reauthorize: no

- name: docker pull
  shell: "docker pull dockerhub.company.ru:5000/projectname/{{ item }}:{{ tag_name }}"
  with_items:
    - "{{ images }}"

- name: docker save
  shell: "docker save dockerhub.company.ru:5000/projectname/{{ item }}:{{ tag_name }} > /tmp/{{ item }}_{{ tag_name }}.tar"
  with_items:
    - "{{ images }}"